<p>Just because you <em>can</em> do something, doesn't mean you should, and that's the case with nested ternary operations. Nesting ternary operators
results in the kind of code that may seem clear as day when you write it, but six months later will leave maintainers (or worse - future you)
scratching their heads and cursing.</p>
<p>Instead, err on the side of clarity, and use another line to express the nested operation as a separate statement.</p>
<h2>Noncompliant Code Example</h2>
<pre>
public String getTitle(Person p) {
  return p.gender == Person.MALE ? "Mr. " : p.isMarried() ? "Mrs. " : "Miss ";  // Noncompliant
}
</pre>
<h2>Compliant Solution</h2>
<pre>
public String getTitle(Person p) {
  if (p.gender == Person.MALE) {
    return "Mr. ";
  }
  return p.isMarried() ? "Mrs. " : "Miss ";
}
</pre>

